Optimal. Leaf size=177 \[ -\frac {3 (a+b) \left (a^2+7 a b+8 b^2\right ) \log (1-\sin (c+d x))}{16 d}+\frac {3 (a-b) \left (a^2-7 a b+8 b^2\right ) \log (\sin (c+d x)+1)}{16 d}-\frac {29 a b^2 \sin (c+d x)}{8 d}-\frac {\sec ^2(c+d x) (5 a \sin (c+d x)+8 b) (a+b \sin (c+d x))^2}{8 d}+\frac {\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}-\frac {b^3 \sin ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 177, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2837, 12, 1645, 1629, 633, 31} \[ -\frac {3 (a+b) \left (a^2+7 a b+8 b^2\right ) \log (1-\sin (c+d x))}{16 d}+\frac {3 (a-b) \left (a^2-7 a b+8 b^2\right ) \log (\sin (c+d x)+1)}{16 d}-\frac {29 a b^2 \sin (c+d x)}{8 d}-\frac {\sec ^2(c+d x) (5 a \sin (c+d x)+8 b) (a+b \sin (c+d x))^2}{8 d}+\frac {\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}-\frac {b^3 \sin ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 31
Rule 633
Rule 1629
Rule 1645
Rule 2837
Rubi steps
\begin {align*} \int \sec (c+d x) (a+b \sin (c+d x))^3 \tan ^4(c+d x) \, dx &=\frac {b^5 \operatorname {Subst}\left (\int \frac {x^4 (a+x)^3}{b^4 \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b \operatorname {Subst}\left (\int \frac {x^4 (a+x)^3}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}+\frac {\operatorname {Subst}\left (\int \frac {(a+x)^2 \left (-a b^4-4 b^4 x-4 a b^2 x^2-4 b^2 x^3\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 b d}\\ &=-\frac {\sec ^2(c+d x) (8 b+5 a \sin (c+d x)) (a+b \sin (c+d x))^2}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}+\frac {\operatorname {Subst}\left (\int \frac {(a+x) \left (b^4 \left (3 a^2+16 b^2\right )+21 a b^4 x+8 b^4 x^2\right )}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{8 b^3 d}\\ &=-\frac {\sec ^2(c+d x) (8 b+5 a \sin (c+d x)) (a+b \sin (c+d x))^2}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}+\frac {\operatorname {Subst}\left (\int \left (-29 a b^4-8 b^4 x+\frac {3 \left (a b^4 \left (a^2+15 b^2\right )+8 b^4 \left (a^2+b^2\right ) x\right )}{b^2-x^2}\right ) \, dx,x,b \sin (c+d x)\right )}{8 b^3 d}\\ &=-\frac {29 a b^2 \sin (c+d x)}{8 d}-\frac {b^3 \sin ^2(c+d x)}{2 d}-\frac {\sec ^2(c+d x) (8 b+5 a \sin (c+d x)) (a+b \sin (c+d x))^2}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}+\frac {3 \operatorname {Subst}\left (\int \frac {a b^4 \left (a^2+15 b^2\right )+8 b^4 \left (a^2+b^2\right ) x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{8 b^3 d}\\ &=-\frac {29 a b^2 \sin (c+d x)}{8 d}-\frac {b^3 \sin ^2(c+d x)}{2 d}-\frac {\sec ^2(c+d x) (8 b+5 a \sin (c+d x)) (a+b \sin (c+d x))^2}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}-\frac {\left (3 (a-b) \left (a^2-7 a b+8 b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{16 d}+\frac {\left (3 (a+b) \left (a^2+7 a b+8 b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{16 d}\\ &=-\frac {3 (a+b) \left (a^2+7 a b+8 b^2\right ) \log (1-\sin (c+d x))}{16 d}+\frac {3 (a-b) \left (a^2-7 a b+8 b^2\right ) \log (1+\sin (c+d x))}{16 d}-\frac {29 a b^2 \sin (c+d x)}{8 d}-\frac {b^3 \sin ^2(c+d x)}{2 d}-\frac {\sec ^2(c+d x) (8 b+5 a \sin (c+d x)) (a+b \sin (c+d x))^2}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.57, size = 174, normalized size = 0.98 \[ \frac {3 \left (a^2-7 a b+8 b^2\right ) (a-b) \log (\sin (c+d x)+1)-3 (a+b) \left (a^2+7 a b+8 b^2\right ) \log (1-\sin (c+d x))-48 a b^2 \sin (c+d x)-\frac {(a-b)^3}{(\sin (c+d x)+1)^2}+\frac {(5 a-11 b) (a-b)^2}{\sin (c+d x)+1}+\frac {(a+b)^2 (5 a+11 b)}{\sin (c+d x)-1}+\frac {(a+b)^3}{(\sin (c+d x)-1)^2}-8 b^3 \sin ^2(c+d x)}{16 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 208, normalized size = 1.18 \[ \frac {8 \, b^{3} \cos \left (d x + c\right )^{6} - 4 \, b^{3} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{3} - 8 \, a^{2} b + 15 \, a b^{2} - 8 \, b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (a^{3} + 8 \, a^{2} b + 15 \, a b^{2} + 8 \, b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 12 \, a^{2} b + 4 \, b^{3} - 24 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} - 2 \, {\left (24 \, a b^{2} \cos \left (d x + c\right )^{4} - 2 \, a^{3} - 6 \, a b^{2} + {\left (5 \, a^{3} + 27 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.32, size = 221, normalized size = 1.25 \[ -\frac {8 \, b^{3} \sin \left (d x + c\right )^{2} + 48 \, a b^{2} \sin \left (d x + c\right ) - 3 \, {\left (a^{3} - 8 \, a^{2} b + 15 \, a b^{2} - 8 \, b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) + 3 \, {\left (a^{3} + 8 \, a^{2} b + 15 \, a b^{2} + 8 \, b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (18 \, a^{2} b \sin \left (d x + c\right )^{4} + 18 \, b^{3} \sin \left (d x + c\right )^{4} + 5 \, a^{3} \sin \left (d x + c\right )^{3} + 27 \, a b^{2} \sin \left (d x + c\right )^{3} - 12 \, a^{2} b \sin \left (d x + c\right )^{2} - 24 \, b^{3} \sin \left (d x + c\right )^{2} - 3 \, a^{3} \sin \left (d x + c\right ) - 21 \, a b^{2} \sin \left (d x + c\right ) + 8 \, b^{3}\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{16 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.33, size = 385, normalized size = 2.18 \[ \frac {a^{3} \left (\sin ^{5}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}-\frac {a^{3} \left (\sin ^{5}\left (d x +c \right )\right )}{8 d \cos \left (d x +c \right )^{2}}-\frac {a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{8 d}-\frac {3 a^{3} \sin \left (d x +c \right )}{8 d}+\frac {3 a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {3 a^{2} b \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}-\frac {3 a^{2} b \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {3 a^{2} b \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {3 a \,b^{2} \left (\sin ^{7}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}-\frac {9 a \,b^{2} \left (\sin ^{7}\left (d x +c \right )\right )}{8 d \cos \left (d x +c \right )^{2}}-\frac {9 a \,b^{2} \left (\sin ^{5}\left (d x +c \right )\right )}{8 d}-\frac {15 a \,b^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{8 d}-\frac {45 a \,b^{2} \sin \left (d x +c \right )}{8 d}+\frac {45 a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {b^{3} \left (\sin ^{8}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}-\frac {b^{3} \left (\sin ^{8}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{2}}-\frac {b^{3} \left (\sin ^{6}\left (d x +c \right )\right )}{2 d}-\frac {3 \left (\sin ^{4}\left (d x +c \right )\right ) b^{3}}{4 d}-\frac {3 b^{3} \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {3 b^{3} \ln \left (\cos \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 190, normalized size = 1.07 \[ -\frac {8 \, b^{3} \sin \left (d x + c\right )^{2} + 48 \, a b^{2} \sin \left (d x + c\right ) - 3 \, {\left (a^{3} - 8 \, a^{2} b + 15 \, a b^{2} - 8 \, b^{3}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (a^{3} + 8 \, a^{2} b + 15 \, a b^{2} + 8 \, b^{3}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left ({\left (5 \, a^{3} + 27 \, a b^{2}\right )} \sin \left (d x + c\right )^{3} - 18 \, a^{2} b - 10 \, b^{3} + 12 \, {\left (2 \, a^{2} b + b^{3}\right )} \sin \left (d x + c\right )^{2} - 3 \, {\left (a^{3} + 7 \, a b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{16 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.11, size = 449, normalized size = 2.54 \[ \frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (3\,a^2\,b+3\,b^3\right )}{d}-\frac {\left (-\frac {3\,a^3}{4}-\frac {45\,a\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+\left (-6\,a^2\,b-6\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\left (\frac {5\,a^3}{4}+\frac {75\,a\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (12\,a^2\,b+12\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+\left (\frac {15\,a^3}{2}+\frac {33\,a\,b^2}{2}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (36\,a^2\,b+4\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {15\,a^3}{2}+\frac {33\,a\,b^2}{2}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (12\,a^2\,b+12\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {5\,a^3}{4}+\frac {75\,a\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (-6\,a^2\,b-6\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\left (-\frac {3\,a^3}{4}-\frac {45\,a\,b^2}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}-\frac {3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left (a+b\right )\,\left (a^2+7\,a\,b+8\,b^2\right )}{8\,d}+\frac {3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,\left (a-b\right )\,\left (a^2-7\,a\,b+8\,b^2\right )}{8\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________